<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<div id="feedcontent">
    <c:forEach items="${feedList}" var="feed">
        <c:if test="${feed.type == 'LiveMediaFeed'}">
            <div class="feed">
                <c:if test="${feed.typeOfAttendant == 'ATHLETE'}">
                    <a href="/norsemanserver/profile?username=<c:out value = "${feed.username}"/>&typeOfBrowse=feed&routeId=<c:out value="${routeId}"/>"
                       style="padding-right:10px;float:left;">
                        <img width="50px" height="50px" src='<c:out value = "${feed.profilePicture}"/>'
                             alt='<c:out value = "${feed.username}"/>'/>
                    </a>
                </c:if>
                <c:if test="${feed.typeOfAttendant == 'SUPPORT'}">
                    <a href="/norsemanserver/profile?username=<c:out value = "${feed.athleteUsername}"/>&typeOfBrowse=feed&routeId=<c:out value="${routeId}"/>"
                       style="padding-right:10px;float:left;">
                        <img width="50px" height="50px" src='<c:out value = "${feed.athleteProfilePicture}"/>'
                             alt='<c:out value = "${feed.athleteUsername}"/>'/>
                    </a>
                </c:if>


                <div class="feedright">
                    <c:if test="${feed.typeOfAttendant == 'ATHLETE'}">
                        <a href="/norsemanserver/profile?username=<c:out value = "${feed.username}"/>&typeOfBrowse=feed&routeId=<c:out value="${routeId}"/>">
                            <c:out value="${feed.username}"/>
                        </a>
                    </c:if>
                    <c:if test="${feed.typeOfAttendant == 'SUPPORT'}">
                        <a href="/norsemanserver/profile?username=<c:out value = "${feed.athleteUsername}"/>&typeOfBrowse=feed&routeId=<c:out value="${routeId}"/>">
                            <c:out value="${feed.athleteUsername}"/>
                        </a>
                    </c:if>

                    <c:out value="${feed.description}"/>

                    <c:if test="${feed.typeOfAttendant == 'ATHLETE'}">
                        <a href="/norsemanserver/geoTagged?username=<c:out value = "${feed.username}"/>&routeId=<c:out value="${routeId}"/>&lat=<c:out value = "${feed.lat}"/>&lng=<c:out value = "${feed.lng}"/>">
                            View on map.
                        </a>
                    </c:if>
                    <c:if test="${feed.typeOfAttendant == 'SUPPORT'}">
                        <a href="/norsemanserver/geoTagged?username=<c:out value = "${feed.athleteUsername}"/>&routeId=<c:out value="${routeId}"/>&lat=<c:out value = "${feed.lat}"/>&lng=<c:out value = "${feed.lng}"/>">
                            View on map.
                        </a>
                    </c:if>

                    <div>
                        <img style="cursor:pointer;" class="feed_image"
                             onclick="tickerMediaClick('${feed.relativeFilePath}')"
                             src='<c:out value = "${feed.relativeFilePath}"/>'/>
                    </div>
                    <div>At <c:out value="${feed.timestampString}"/></div>
                </div>
            </div>
            <div class="feedseparator"></div>
        </c:if>
    </c:forEach>
</div>